package com.ssl.common.utils;

import com.alibaba.fastjson.JSON;

public class JsonUtils {

    public static <T> T readValue(String jsonValue, Class<T> clazz) {
        return JSON.parseObject(jsonValue, clazz);
    }

    public static String toJSONString(Object obj) {
        return JSON.toJSONString(obj);
    }

    public static <T> T readValueFromObject(Object objectValue, Class<T> clazz) {
        return JSON.parseObject(toJSONString(objectValue), clazz);
    }
}
